//
// Created by sjjmw on 3/24/2022.
//
#include "iostream"
#include "vector"
#include "list"
#include "algorithm"
#include "string"
#include "unordered_map"
#include "cmath"
#include<iomanip>
#include "string"
#include "map"
#include "list"

//一组结果不一定要通过push来放。
//如果要求从小到大输出，直接通过标记即可。

struct Tong{
    int cur=0;
    int capacity=0;
};
struct Sol{
    std::vector<int> _appeared;
    bool appeared(int a,int b,int c){
        return _appeared[a*21*21+b*21+c];
    }
    void set_appeared(int a,int b,int c){
        _appeared[a*21*21+b*21+c]=1;
    }
    Tong ta;
    Tong tb;
    Tong tc;
    void a2b(Tong&a1,Tong&b1){
        if(a1.cur<=b1.capacity-b1.cur){
            //a1可以全部给b1
            b1.cur+=a1.cur;
            a1.cur=0;
        }else{
            //a1只能给一部分
            a1.cur-=b1.capacity-b1.cur;
            b1.cur=b1.capacity;
        }
    }
    std::vector<int>res;
    void dfs(){
        if(appeared(ta.cur,tb.cur,tc.cur)){
            return;
        }
        set_appeared(ta.cur,tb.cur,tc.cur);
        if(ta.cur==0){
            res[tc.cur]=1;
//            res.push_back(tc.cur);
        }
        Tong ta_bak,tb_bak,tc_bak;

        ta_bak=ta;
        tb_bak=tb;
        tc_bak=tc;

        //a->b
        a2b(ta,tb);
        dfs();
        ta=ta_bak;tb=tb_bak;tc=tc_bak;
        //a->c
        a2b(ta,tc);
        dfs();
        ta=ta_bak;tb=tb_bak;tc=tc_bak;
        //b->a
        a2b(tb,ta);
        dfs();
        ta=ta_bak;tb=tb_bak;tc=tc_bak;
        //b->c
        a2b(tb,tc);
        dfs();
        ta=ta_bak;tb=tb_bak;tc=tc_bak;
        //c->a
        a2b(tc,ta);
        dfs();
        ta=ta_bak;tb=tb_bak;tc=tc_bak;
        //c->b
        a2b(tc,tb);
        dfs();
        ta=ta_bak;tb=tb_bak;tc=tc_bak;
    }
    void handle(int a,int b,int c
            ){
        _appeared.resize(21*21*21);
        res.resize(21);
        ta.capacity=a;
        tb.capacity=b;
        tc.capacity=c;
        tc.cur=c;

        dfs();
        bool first= true;
        for(int i=0;i<res.size();i++){
            if(res[i]){
                if(!first){
                    printf(" ");
                }
                first= false;
                printf("%d",i);
            }
        }
        printf("\n");
        ;
    }
};
int main(){
//    int a,b,c;
    float a,b,c,d;
    int e;
    while(std::cin>>a>>b>>c){
        Sol().handle(a,b,c);
    }

    return 0;
}